package com.cenxi.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author cenxi
 * 直播推流鉴权
 * @Date 2023/11/2 17:07
 * @Version 1.0
 */

@RestController
@RequestMapping("/rtmp")
@Slf4j
public class AuthController {

    @PostMapping("/auth")
    public Object auth(HttpServletRequest request, String name) {
        String name1 = request.getParameter("name");
        log.info("推流授权1: {}", name);
       return "推流授权1";
    }

    @PostMapping("/discharging")
    public Object discharging(HttpServletRequest request, String name) {
        log.info("放行: {}", name);
        return "放行";
    }
}
